package model.filtros;

import static org.junit.Assert.*;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import org.junit.Test;

public class OrTest extends FiltrosDeBusquedaTest {
	
	@Test
	public void testOrDelegaYCoincide() {
		when(filtroMock1.coincide(prestamoMock)).thenReturn(true);
		when(filtroMock1.o(filtroMock2)).thenCallRealMethod();
		assertTrue(filtroMock1.o(filtroMock2).coincide(prestamoMock));
		verify(filtroMock1).coincide(prestamoMock);
	}
	
	@Test
	public void testOrDelegaYNoCoincide() {
		when(filtroMock1.coincide(prestamoMock)).thenReturn(false);
		when(filtroMock1.o(filtroMock2)).thenCallRealMethod();
		when(filtroMock2.coincide(prestamoMock)).thenReturn(false);
		assertFalse(filtroMock1.o(filtroMock2).coincide(prestamoMock));
		verify(filtroMock1).coincide(prestamoMock);
		verify(filtroMock2).coincide(prestamoMock);
	}

}
